package com.red.dubbosimulate.provider;

import com.red.dubbosimulate.framework.Protocol;
import com.red.dubbosimulate.framework.ProtocolFactory;
import com.red.dubbosimulate.framework.URL;
import com.red.dubbosimulate.framework.protocol.http.HttpProtocol;
import com.red.dubbosimulate.framework.protocol.http.HttpServer;
import com.red.dubbosimulate.framework.register.LocalRegister;
import com.red.dubbosimulate.framework.register.RemoteMapRegister;
import com.red.dubbosimulate.provider.api.HelloService;
import com.red.dubbosimulate.provider.impl.HelloServiceImpl;

public class Provider {

    public static void main(String[] args) {

        LocalRegister.regist(HelloService.class.getName(), HelloServiceImpl.class);
        URL url = new URL("localhost",8080);
        RemoteMapRegister.regist(HelloService.class.getName(),url);
        Protocol protocol = ProtocolFactory.getProtocol();
        protocol.start(url);
    }
}
